package com.niiwoo.civet.base.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 还款类型枚举
 * Created by yuanguang on 2018/4/21.
 */
@AllArgsConstructor
@Getter
public enum OrderRefundTypeEnum {
    NORMAL_REFUND((byte)1,"正常还款"),
    OVERDUE_REFUND((byte)2,"逾期还款"),
    BADLOAN_REFUND((byte)3,"坏账还款"),
    OVERDEPT_REFUND((byte)4,"提前结清");

    private Byte refundType;
    private String desc;
    public static OrderRefundTypeEnum enumOf(Byte refundType) {

        for (OrderRefundTypeEnum orderRefundTypeEnum : values()) {
            if (orderRefundTypeEnum.refundType == refundType) {
                return orderRefundTypeEnum;
            }
        }
        throw new NoSuchEnumValueException("OrderRefundTypeEnum:" + refundType);
    }
}
